<script lang="ts">
import { defineComponent, onMounted, h } from "vue";
import { useRoute, useRouter } from "vue-router";
import mitter from "@/plugins/mitt";
export default defineComponent({
	name: "Redirect",
	setup() {
		const route = useRoute(),
			router = useRouter();
		onMounted(() => {
			// 移除 缓存组件名称 -> my-router-view
			mitter.$emit("removeKeepAlive", "");
			router.replace({ path: route.query.path as string });
		});
		return () => h("span");
	},
});
</script>
